<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <!-- Style -->
    <link rel="stylesheet" type="text/css" href="index.css">
</head>

<body>
    <!-- 页面 -->
    <div id="app">
        <!-- 搜索 -->
        <div class="search">
            <!-- 输入框 -->
            <input class="input" ref="input" type="text" v-model="keyword" spellcheck="false" :placeholder="placeholder"
                @input="onInputChange" @keydown.enter="onEnterBtnClick" @keydown.up="onUpBtnClick"
                @keydown.down="onDownBtnClick" @keydown.left="onLeftBtnClick" @keydown.right="onRightBtnClick"
                autofocus></input>
            <!-- 按钮 -->
            <button class="btn" v-text="button" @click="onEnterBtnClick"></button>
        </div>
        <!-- 结果列表 -->
        <div class="result" v-if="results.length > 0">
            <ul class="list">
                <li class="item" v-for="(item, index) in results" :key="index" :id="'item-' + index"
                    :class="{ 'item-selected': (index === curIndex) }" @click="onResultClick(item, index)" v-cloak>
                    <img class="icon" :src="getIcon(item.extname)" alt="icon"></img>
                    <span class="name">{{item.name}}</span>
                </li>
            </ul>
        </div>
    </div>
    <!-- 脚本 -->
    <script src="../../lib/vue.min.js"></script>
    <script src="index.js"></script>
</body>

</html>